/**
 * 
 */
package tarena.netctoss.service.impl;

import java.util.List;

import tarena.netctoss.dao.BusinessCondition;
import tarena.netctoss.dao.BusinessDao;
import tarena.netctoss.dao.Pagination;
import tarena.netctoss.po.Business;
import tarena.netctoss.service.BusinessService;

/**
 * 用户所拥有的业务的业务实现
 * 
 * @author Wangpeihu
 * @team [Never give up]
 * @since JDK1.6(建议)
 * @date 2010-3-9
 */

public class BusinessServcieImpl implements BusinessService {

	private BusinessDao businessDao;

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * tarena.netctoss.service.BusinessService#delete(tarena.netctoss.po.Business
	 * )
	 */
	@Override
	public void delete(Business business) {
		businessDao.delete(business);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @seetarena.netctoss.service.BusinessService#findAll(tarena.netctoss.dao.
	 * BusinessCondition)
	 */
	@Override
	public List<Business> findAll(BusinessCondition bc) {
		return businessDao.findAll(bc);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see tarena.netctoss.service.BusinessService#findAll()
	 */
	@Override
	public List<Business> findAll() {
		return businessDao.findAll();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @seetarena.netctoss.service.BusinessService#findAll(tarena.netctoss.dao.
	 * BusinessCondition, tarena.netctoss.dao.Pagination)
	 */
	@Override
	public List<Business> findAll(BusinessCondition bc, Pagination page) {
		businessDao.loadMaxPage(page, bc); // 加载最大页页号
		return businessDao.findAll(bc, page);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see tarena.netctoss.service.BusinessService#findById(java.lang.Integer)
	 */
	@Override
	public Business findById(Integer id) {
		return businessDao.findById(id);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * tarena.netctoss.service.BusinessService#save(tarena.netctoss.po.Business)
	 */
	@Override
	public void save(Business business) {
		businessDao.save(business);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * tarena.netctoss.service.BusinessService#update(tarena.netctoss.po.Business
	 * )
	 */
	@Override
	public void update(Business business) {
		businessDao.update(business);

	}

	/**
	 * 依赖注入
	 * 
	 * @param businessDao
	 */
	public void setBusinessDao(BusinessDao businessDao) {
		this.businessDao = businessDao;
	}

}
